package gemini.basic.manager;

import gemini.basic.dto.SearchDistributorCriteria;
import gemini.basic.dto.SearchDistributorResult;
import gemini.basic.exception.UserExistedException;
import gemini.basic.model.Customer;
import gemini.basic.model.Distributor;
import gemini.basic.model.Event;
import gemini.basic.model.Level;
import gemini.basic.model.MonthlyPoint;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

@Transactional(rollbackFor = Throwable.class)
public interface DistributorManager {

	public Distributor init(Distributor distributor);

	public Distributor getDistributorByCodePin(String code, String pin)
			throws UserExistedException;

	public Distributor active(String code);

	public Distributor getPlaceHolder();

	public Distributor getByCode(String code);

	public List<SearchDistributorResult> findDistributor(
			SearchDistributorCriteria criteria);

	public Distributor fetchDownlineByCode(String code);

	public Distributor getSponsorByCode(String code);

	public int updateLevel();

	public Level saveOrUpdateLevel(Level level);

	public List<Level> getAllLevels();

	public void deleteLevel(Integer id);

	public List<Event> getEventByDistributorCode(String code);

	public Event saveOrUpdateEvent(Event event);

	public void deleteEvent(int id);

	public List<Customer> getCustomerByDistributorCode(String code);

	public Customer saveOrUpdateCustomer(Customer customer);

	public void deleteCustomer(int id);

	public void sumPoint();
	
	public List<MonthlyPoint> getMonthlyPointByDistributorCodeAndYear(String code,int year);
	
	public List<Integer> getAllYearByDistributorCode(String code);

}
